package server;

import java.util.ArrayList;
import java.util.List;

public class Mapper {

    private List<Service> serviceList = new ArrayList<>();

    public List<Service> getServiceList() {
        return serviceList;
    }

    public void setServiceList(List<Service> serviceList) {
        this.serviceList = serviceList;
    }

    static class Service {
        private List<Connector> connectorList = new ArrayList<>();
        private Engine engine;

        public List<Connector> getConnectorList() {
            return connectorList;
        }

        public void setConnectorList(List<Connector> connectorList) {
            this.connectorList = connectorList;
        }

        public Engine getEngine() {
            return engine;
        }

        public void setEngine(Engine engine) {
            this.engine = engine;
        }
    }

    static class Connector {

        private int port;

        public int getPort() {
            return port;
        }

        public void setPort(int port) {
            this.port = port;
        }
    }

    static class Engine {
        private List<Host> hostList = new ArrayList<>();

        public List<Host> getHostList() {
            return hostList;
        }

        public void setHostList(List<Host> hostList) {
            this.hostList = hostList;
        }
    }


    static class Host {
       private String name;
       private String appbase;

        private List<Context> contextList = new ArrayList<>();

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getAppbase() {
            return appbase;
        }

        public void setAppbase(String appbase) {
            this.appbase = appbase;
        }

        public List<Context> getContextList() {
            return contextList;
        }

        public void setContextList(List<Context> contextList) {
            this.contextList = contextList;
        }
    }

    static class Context {
        private String path;

        private List<Wrapper> wrapperList = new ArrayList<>();

        public String getPath() {
            return path;
        }

        public void setPath(String path) {
            this.path = path;
        }

        public List<Wrapper> getWrapperList() {
            return wrapperList;
        }

        public void setWrapperList(List<Wrapper> wrapperList) {
            this.wrapperList = wrapperList;
        }
    }

    static class Wrapper {
        private String url;
        private HttpServlet httpServlet;

        public Wrapper(String url, HttpServlet httpServlet) {
            this.url = url;
            this.httpServlet = httpServlet;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public HttpServlet getHttpServlet() {
            return httpServlet;
        }

        public void setHttpServlet(HttpServlet httpServlet) {
            this.httpServlet = httpServlet;
        }
    }




}
